﻿namespace GDPView.Models
{
    public class PaginationHelper<T>
    {
        public int PageIndex { get; set; }
        public int PageSize { get; set; }
        public int TotalCount { get; set; }
        public int TotalPages { get; set; }
        public List<T> Items { get; set; }

        public PaginationHelper(int pageIndex, int pageSize, List<T> items)
        {
            PageIndex = pageIndex;
            PageSize = pageSize;
            Items = items;
            TotalCount = Items.Count;
            TotalPages = (int)Math.Ceiling(1.0 * TotalCount / PageSize);
        }
    }

}
